# Contributor: Ogromny <ogromnycoding@gmail.com>
# Maintainer: Ogromny <ogromnycoding@gmail.com>
pkgname=niri
pkgver=0.1.9
pkgrel=1
pkgdesc="A scrollable-tiling Wayland compositor"
url="https://github.com/YaLTeR/niri"
arch="x86_64 ppc64le aarch64"
license="GPL-3.0-only"
makedepends="
	cargo
	cargo-auditable
	clang-libclang
	clang-libs
	eudev-dev
	glib-dev
	libdisplay-info-dev
	libinput-dev
	libseat-dev
	libxkbcommon-dev
	mesa-dev
	pango-dev
	pipewire-dev
	rust
	"
subpackages="
	$pkgname-portalsconf
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/YaLTeR/niri/archive/refs/tags/v$pkgver.tar.gz"

build() {
	cargo auditable build \
		--release \
		--no-default-features \
		--features dbus,xdp-gnome-screencast
}

check() {
	cargo test \
		--release \
		--no-default-features \
		--features dbus,xdp-gnome-screencast
}

package() {
	install -Dm755 target/release/niri -t "$pkgdir"/usr/bin/
	install -Dm644 resources/niri.desktop -t "$pkgdir"/usr/share/wayland-sessions/
	install -Dm644 resources/niri-portals.conf -t "$pkgdir"/usr/share/xdg-desktop-portal/
}

portalsconf() {
	pkgdesc="xdg-desktop-portal configuration of compatible portals for Niri"
	install_if="$pkgname=$pkgver-r$pkgrel"
	depends="xdg-desktop-portal xdg-desktop-portal-gnome"
	amove usr/share/xdg-desktop-portal/niri-portals.conf
}


sha512sums="
7436ad537b6f4e2d0b05731d94bf02594310526843083a175c061327958d7673d19ec601732969f9910c4e41b97be64a04d2a1eac3c7ec19c4d71a31fdad8d6c  niri-0.1.9.tar.gz
"
